/*
 * Copyright (c) 2025 Huawei Device Co., Ltd.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#ifndef OHOS_MULTIMODALINPUT_KEY_CODE_IMPL_H
#define OHOS_MULTIMODALINPUT_KEY_CODE_IMPL_H

#include "define_multimodal.h"
#include "ohos.multimodalInput.keyCode.proj.hpp"
#include "ohos.multimodalInput.keyCode.impl.hpp"
#include "taihe/runtime.hpp"
#include "stdexcept"

#include <map>

namespace OHOS {
namespace MMI {
using namespace ohos::multimodalInput::keyCode;

enum KeyCodeEts {
    KEYCODE_FN_ETS = 0,
    KEYCODE_UNKNOWN_ETS = -1,
    KEYCODE_HOME_ETS = 1,
    KEYCODE_BACK_ETS = 2,
    KEYCODE_SEARCH_ETS = 9,
    KEYCODE_MEDIA_PLAY_PAUSE_ETS = 10,
    KEYCODE_MEDIA_STOP_ETS = 11,
    KEYCODE_MEDIA_NEXT_ETS = 12,
    KEYCODE_MEDIA_PREVIOUS_ETS = 13,
    KEYCODE_MEDIA_REWIND_ETS = 14,
    KEYCODE_MEDIA_FAST_FORWARD_ETS = 15,
    KEYCODE_VOLUME_UP_ETS = 16,
    KEYCODE_VOLUME_DOWN_ETS = 17,
    KEYCODE_POWER_ETS = 18,
    KEYCODE_CAMERA_ETS = 19,
    KEYCODE_VOLUME_MUTE_ETS = 22,
    KEYCODE_MUTE_ETS = 23,
    KEYCODE_BRIGHTNESS_UP_ETS = 40,
    KEYCODE_BRIGHTNESS_DOWN_ETS = 41,
    KEYCODE_0_ETS = 2000,
    KEYCODE_1_ETS = 2001,
    KEYCODE_2_ETS = 2002,
    KEYCODE_3_ETS = 2003,
    KEYCODE_4_ETS = 2004,
    KEYCODE_5_ETS = 2005,
    KEYCODE_6_ETS = 2006,
    KEYCODE_7_ETS = 2007,
    KEYCODE_8_ETS = 2008,
    KEYCODE_9_ETS = 2009,
    KEYCODE_STAR_ETS = 2010,
    KEYCODE_POUND_ETS = 2011,
    KEYCODE_DPAD_UP_ETS = 2012,
    KEYCODE_DPAD_DOWN_ETS = 2013,
    KEYCODE_DPAD_LEFT_ETS = 2014,
    KEYCODE_DPAD_RIGHT_ETS = 2015,
    KEYCODE_DPAD_CENTER_ETS = 2016,
    KEYCODE_A_ETS = 2017,
    KEYCODE_B_ETS = 2018,
    KEYCODE_C_ETS = 2019,
    KEYCODE_D_ETS = 2020,
    KEYCODE_E_ETS = 2021,
    KEYCODE_F_ETS = 2022,
    KEYCODE_G_ETS = 2023,
    KEYCODE_H_ETS = 2024,
    KEYCODE_I_ETS = 2025,
    KEYCODE_J_ETS = 2026,
    KEYCODE_K_ETS = 2027,
    KEYCODE_L_ETS = 2028,
    KEYCODE_M_ETS = 2029,
    KEYCODE_N_ETS = 2030,
    KEYCODE_O_ETS = 2031,
    KEYCODE_P_ETS = 2032,
    KEYCODE_Q_ETS = 2033,
    KEYCODE_R_ETS = 2034,
    KEYCODE_S_ETS = 2035,
    KEYCODE_T_ETS = 2036,
    KEYCODE_U_ETS = 2037,
    KEYCODE_V_ETS = 2038,
    KEYCODE_W_ETS = 2039,
    KEYCODE_X_ETS = 2040,
    KEYCODE_Y_ETS = 2041,
    KEYCODE_Z_ETS = 2042,
    KEYCODE_COMMA_ETS = 2043,
    KEYCODE_PERIOD_ETS = 2044,
    KEYCODE_ALT_LEFT_ETS = 2045,
    KEYCODE_ALT_RIGHT_ETS = 2046,
    KEYCODE_SHIFT_LEFT_ETS = 2047,
    KEYCODE_SHIFT_RIGHT_ETS = 2048,
    KEYCODE_TAB_ETS = 2049,
    KEYCODE_SPACE_ETS = 2050,
    KEYCODE_SYM_ETS = 2051,
    KEYCODE_EXPLORER_ETS = 2052,
    KEYCODE_ENVELOPE_ETS = 2053,
    KEYCODE_ENTER_ETS = 2054,
    KEYCODE_DEL_ETS = 2055,
    KEYCODE_GRAVE_ETS = 2056,
    KEYCODE_MINUS_ETS = 2057,
    KEYCODE_EQUALS_ETS = 2058,
    KEYCODE_LEFT_BRACKET_ETS = 2059,
    KEYCODE_RIGHT_BRACKET_ETS = 2060,
    KEYCODE_BACKSLASH_ETS = 2061,
    KEYCODE_SEMICOLON_ETS = 2062,
    KEYCODE_APOSTROPHE_ETS = 2063,
    KEYCODE_SLASH_ETS = 2064,
    KEYCODE_AT_ETS = 2065,
    KEYCODE_PLUS_ETS = 2066,
    KEYCODE_MENU_ETS = 2067,
    KEYCODE_PAGE_UP_ETS = 2068,
    KEYCODE_PAGE_DOWN_ETS = 2069,
    KEYCODE_ESCAPE_ETS = 2070,
    KEYCODE_FORWARD_DEL_ETS = 2071,
    KEYCODE_CTRL_LEFT_ETS = 2072,
    KEYCODE_CTRL_RIGHT_ETS = 2073,
    KEYCODE_CAPS_LOCK_ETS = 2074,
    KEYCODE_SCROLL_LOCK_ETS = 2075,
    KEYCODE_META_LEFT_ETS = 2076,
    KEYCODE_META_RIGHT_ETS = 2077,
    KEYCODE_FUNCTION_ETS = 2078,
    KEYCODE_SYSRQ_ETS = 2079,
    KEYCODE_BREAK_ETS = 2080,
    KEYCODE_MOVE_HOME_ETS = 2081,
    KEYCODE_MOVE_END_ETS = 2082,
    KEYCODE_INSERT_ETS = 2083,
    KEYCODE_FORWARD_ETS = 2084,
    KEYCODE_MEDIA_PLAY_ETS = 2085,
    KEYCODE_MEDIA_PAUSE_ETS = 2086,
    KEYCODE_MEDIA_CLOSE_ETS = 2087,
    KEYCODE_MEDIA_EJECT_ETS = 2088,
    KEYCODE_MEDIA_RECORD_ETS = 2089,
    KEYCODE_F1_ETS = 2090,
    KEYCODE_F2_ETS = 2091,
    KEYCODE_F3_ETS = 2092,
    KEYCODE_F4_ETS = 2093,
    KEYCODE_F5_ETS = 2094,
    KEYCODE_F6_ETS = 2095,
    KEYCODE_F7_ETS = 2096,
    KEYCODE_F8_ETS = 2097,
    KEYCODE_F9_ETS = 2098,
    KEYCODE_F10_ETS = 2099,
    KEYCODE_F11_ETS = 2100,
    KEYCODE_F12_ETS = 2101,
    KEYCODE_NUM_LOCK_ETS = 2102,
    KEYCODE_NUMPAD_0_ETS = 2103,
    KEYCODE_NUMPAD_1_ETS = 2104,
    KEYCODE_NUMPAD_2_ETS = 2105,
    KEYCODE_NUMPAD_3_ETS = 2106,
    KEYCODE_NUMPAD_4_ETS = 2107,
    KEYCODE_NUMPAD_5_ETS = 2108,
    KEYCODE_NUMPAD_6_ETS = 2109,
    KEYCODE_NUMPAD_7_ETS = 2110,
    KEYCODE_NUMPAD_8_ETS = 2111,
    KEYCODE_NUMPAD_9_ETS = 2112,
    KEYCODE_NUMPAD_DIVIDE_ETS = 2113,
    KEYCODE_NUMPAD_MULTIPLY_ETS = 2114,
    KEYCODE_NUMPAD_SUBTRACT_ETS = 2115,
    KEYCODE_NUMPAD_ADD_ETS = 2116,
    KEYCODE_NUMPAD_DOT_ETS = 2117,
    KEYCODE_NUMPAD_COMMA_ETS = 2118,
    KEYCODE_NUMPAD_ENTER_ETS = 2119,
    KEYCODE_NUMPAD_EQUALS_ETS = 2120,
    KEYCODE_NUMPAD_LEFT_PAREN_ETS = 2121,
    KEYCODE_NUMPAD_RIGHT_PAREN_ETS = 2122,
    KEYCODE_VIRTUAL_MULTITASK_ETS = 2210,
    KEYCODE_BUTTON_A_ETS = 2301,
    KEYCODE_BUTTON_B_ETS = 2302,
    KEYCODE_BUTTON_X_ETS = 2304,
    KEYCODE_BUTTON_Y_ETS = 2305,
    KEYCODE_BUTTON_L1_ETS = 2307,
    KEYCODE_BUTTON_R1_ETS = 2308,
    KEYCODE_BUTTON_L2_ETS = 2309,
    KEYCODE_BUTTON_R2_ETS = 2310,
    KEYCODE_BUTTON_SELECT_ETS = 2311,
    KEYCODE_BUTTON_START_ETS = 2312,
    KEYCODE_BUTTON_MODE_ETS = 2313,
    KEYCODE_BUTTON_THUMBL_ETS = 2314,
    KEYCODE_BUTTON_THUMBR_ETS = 2315,
    KEYCODE_SLEEP_ETS = 2600,
    KEYCODE_ZENKAKU_HANKAKU_ETS = 2601,
    KEYCODE_102ND_ETS = 2602,
    KEYCODE_RO_ETS = 2603,
    KEYCODE_KATAKANA_ETS = 2604,
    KEYCODE_HIRAGANA_ETS = 2605,
    KEYCODE_HENKAN_ETS = 2606,
    KEYCODE_KATAKANA_HIRAGANA_ETS = 2607,
    KEYCODE_MUHENKAN_ETS = 2608,
    KEYCODE_LINEFEED_ETS = 2609,
    KEYCODE_MACRO_ETS = 2610,
    KEYCODE_NUMPAD_PLUSMINUS_ETS = 2611,
    KEYCODE_SCALE_ETS = 2612,
    KEYCODE_HANGUEL_ETS = 2613,
    KEYCODE_HANJA_ETS = 2614,
    KEYCODE_YEN_ETS = 2615,
    KEYCODE_STOP_ETS = 2616,
    KEYCODE_AGAIN_ETS = 2617,
    KEYCODE_PROPS_ETS = 2618,
    KEYCODE_UNDO_ETS = 2619,
    KEYCODE_COPY_ETS = 2620,
    KEYCODE_OPEN_ETS = 2621,
    KEYCODE_PASTE_ETS = 2622,
    KEYCODE_FIND_ETS = 2623,
    KEYCODE_CUT_ETS = 2624,
    KEYCODE_HELP_ETS = 2625,
    KEYCODE_CALC_ETS = 2626,
    KEYCODE_FILE_ETS = 2627,
    KEYCODE_BOOKMARKS_ETS = 2628,
    KEYCODE_NEXT_ETS = 2629,
    KEYCODE_PLAYPAUSE_ETS = 2630,
    KEYCODE_PREVIOUS_ETS = 2631,
    KEYCODE_STOPCD_ETS = 2632,
    KEYCODE_CONFIG_ETS = 2634,
    KEYCODE_REFRESH_ETS = 2635,
    KEYCODE_EXIT_ETS = 2636,
    KEYCODE_EDIT_ETS = 2637,
    KEYCODE_SCROLLUP_ETS = 2638,
    KEYCODE_SCROLLDOWN_ETS = 2639,
    KEYCODE_NEW_ETS = 2640,
    KEYCODE_REDO_ETS = 2641,
    KEYCODE_CLOSE_ETS = 2642,
    KEYCODE_PLAY_ETS = 2643,
    KEYCODE_BASSBOOST_ETS = 2644,
    KEYCODE_PRINT_ETS = 2645,
    KEYCODE_CHAT_ETS = 2646,
    KEYCODE_FINANCE_ETS = 2647,
    KEYCODE_CANCEL_ETS = 2648,
    KEYCODE_KBDILLUM_TOGGLE_ETS = 2649,
    KEYCODE_KBDILLUM_DOWN_ETS = 2650,
    KEYCODE_KBDILLUM_UP_ETS = 2651,
    KEYCODE_SEND_ETS = 2652,
    KEYCODE_REPLY_ETS = 2653,
    KEYCODE_FORWARDMAIL_ETS = 2654,
    KEYCODE_SAVE_ETS = 2655,
    KEYCODE_DOCUMENTS_ETS = 2656,
    KEYCODE_VIDEO_NEXT_ETS = 2657,
    KEYCODE_VIDEO_PREV_ETS = 2658,
    KEYCODE_BRIGHTNESS_CYCLE_ETS = 2659,
    KEYCODE_BRIGHTNESS_ZERO_ETS = 2660,
    KEYCODE_DISPLAY_OFF_ETS = 2661,
    KEYCODE_BTN_MISC_ETS = 2662,
    KEYCODE_GOTO_ETS = 2663,
    KEYCODE_INFO_ETS = 2664,
    KEYCODE_PROGRAM_ETS = 2665,
    KEYCODE_PVR_ETS = 2666,
    KEYCODE_SUBTITLE_ETS = 2667,
    KEYCODE_FULL_SCREEN_ETS = 2668,
    KEYCODE_KEYBOARD_ETS = 2669,
    KEYCODE_ASPECT_RATIO_ETS = 2670,
    KEYCODE_PC_ETS = 2671,
    KEYCODE_TV_ETS = 2672,
    KEYCODE_TV2_ETS = 2673,
    KEYCODE_VCR_ETS = 2674,
    KEYCODE_VCR2_ETS = 2675,
    KEYCODE_SAT_ETS = 2676,
    KEYCODE_CD_ETS = 2677,
    KEYCODE_TAPE_ETS = 2678,
    KEYCODE_TUNER_ETS = 2679,
    KEYCODE_PLAYER_ETS = 2680,
    KEYCODE_DVD_ETS = 2681,
    KEYCODE_AUDIO_ETS = 2682,
    KEYCODE_VIDEO_ETS = 2683,
    KEYCODE_MEMO_ETS = 2684,
    KEYCODE_CALENDAR_ETS = 2685,
    KEYCODE_RED_ETS = 2686,
    KEYCODE_GREEN_ETS = 2687,
    KEYCODE_YELLOW_ETS = 2688,
    KEYCODE_BLUE_ETS = 2689,
    KEYCODE_CHANNELUP_ETS = 2690,
    KEYCODE_CHANNELDOWN_ETS = 2691,
    KEYCODE_LAST_ETS = 2692,
    KEYCODE_RESTART_ETS = 2693,
    KEYCODE_SLOW_ETS = 2694,
    KEYCODE_SHUFFLE_ETS = 2695,
    KEYCODE_VIDEOPHONE_ETS = 2696,
    KEYCODE_GAMES_ETS = 2697,
    KEYCODE_ZOOMIN_ETS = 2698,
    KEYCODE_ZOOMOUT_ETS = 2699,
    KEYCODE_ZOOMRESET_ETS = 2700,
    KEYCODE_WORDPROCESSOR_ETS = 2701,
    KEYCODE_EDITOR_ETS = 2702,
    KEYCODE_SPREADSHEET_ETS = 2703,
    KEYCODE_GRAPHICSEDITOR_ETS = 2704,
    KEYCODE_PRESENTATION_ETS = 2705,
    KEYCODE_DATABASE_ETS = 2706,
    KEYCODE_NEWS_ETS = 2707,
    KEYCODE_VOICEMAIL_ETS = 2708,
    KEYCODE_ADDRESSBOOK_ETS = 2709,
    KEYCODE_MESSENGER_ETS = 2710,
    KEYCODE_BRIGHTNESS_TOGGLE_ETS = 2711,
    KEYCODE_SPELLCHECK_ETS = 2712,
    KEYCODE_COFFEE_ETS = 2713,
    KEYCODE_MEDIA_REPEAT_ETS = 2714,
    KEYCODE_IMAGES_ETS = 2715,
    KEYCODE_BUTTONCONFIG_ETS = 2716,
    KEYCODE_TASKMANAGER_ETS = 2717,
    KEYCODE_JOURNAL_ETS = 2718,
    KEYCODE_CONTROLPANEL_ETS = 2719,
    KEYCODE_APPSELECT_ETS = 2720,
    KEYCODE_SCREENSAVER_ETS = 2721,
    KEYCODE_ASSISTANT_ETS = 2722,
    KEYCODE_KBD_LAYOUT_NEXT_ETS = 2723,
    KEYCODE_BRIGHTNESS_MIN_ETS = 2724,
    KEYCODE_BRIGHTNESS_MAX_ETS = 2725,
    KEYCODE_KBDINPUTASSIST_PREV_ETS = 2726,
    KEYCODE_KBDINPUTASSIST_NEXT_ETS = 2727,
    KEYCODE_KBDINPUTASSIST_PREVGROUP_ETS = 2728,
    KEYCODE_KBDINPUTASSIST_NEXTGROUP_ETS = 2729,
    KEYCODE_KBDINPUTASSIST_ACCEPT_ETS = 2730,
    KEYCODE_KBDINPUTASSIST_CANCEL_ETS = 2731,
    KEYCODE_FRONT_ETS = 2800,
    KEYCODE_SETUP_ETS = 2801,
    KEYCODE_WAKEUP_ETS = 2802,
    KEYCODE_SENDFILE_ETS = 2803,
    KEYCODE_DELETEFILE_ETS = 2804,
    KEYCODE_XFER_ETS = 2805,
    KEYCODE_PROG1_ETS = 2806,
    KEYCODE_PROG2_ETS = 2807,
    KEYCODE_MSDOS_ETS = 2808,
    KEYCODE_SCREENLOCK_ETS = 2809,
    KEYCODE_DIRECTION_ROTATE_DISPLAY_ETS = 2810,
    KEYCODE_CYCLEWINDOWS_ETS = 2811,
    KEYCODE_COMPUTER_ETS = 2812,
    KEYCODE_EJECTCLOSECD_ETS = 2813,
    KEYCODE_ISO_ETS = 2814,
    KEYCODE_MOVE_ETS = 2815,
    KEYCODE_F13_ETS = 2816,
    KEYCODE_F14_ETS = 2817,
    KEYCODE_F15_ETS = 2818,
    KEYCODE_F16_ETS = 2819,
    KEYCODE_F17_ETS = 2820,
    KEYCODE_F18_ETS = 2821,
    KEYCODE_F19_ETS = 2822,
    KEYCODE_F20_ETS = 2823,
    KEYCODE_F21_ETS = 2824,
    KEYCODE_F22_ETS = 2825,
    KEYCODE_F23_ETS = 2826,
    KEYCODE_F24_ETS = 2827,
    KEYCODE_PROG3_ETS = 2828,
    KEYCODE_PROG4_ETS = 2829,
    KEYCODE_DASHBOARD_ETS = 2830,
    KEYCODE_SUSPEND_ETS = 2831,
    KEYCODE_HP_ETS = 2832,
    KEYCODE_SOUND_ETS = 2833,
    KEYCODE_QUESTION_ETS = 2834,
    KEYCODE_CONNECT_ETS = 2836,
    KEYCODE_SPORT_ETS = 2837,
    KEYCODE_SHOP_ETS = 2838,
    KEYCODE_ALTERASE_ETS = 2839,
    KEYCODE_SWITCHVIDEOMODE_ETS = 2841,
    KEYCODE_BATTERY_ETS = 2842,
    KEYCODE_BLUETOOTH_ETS = 2843,
    KEYCODE_WLAN_ETS = 2844,
    KEYCODE_UWB_ETS = 2845,
    KEYCODE_WWAN_WIMAX_ETS = 2846,
    KEYCODE_RFKILL_ETS = 2847,
    KEYCODE_CHANNEL_ETS = 3001,
    KEYCODE_BTN_0_ETS = 3100,
    KEYCODE_BTN_1_ETS = 3101,
    KEYCODE_BTN_2_ETS = 3102,
    KEYCODE_BTN_3_ETS = 3103,
    KEYCODE_BTN_4_ETS = 3104,
    KEYCODE_BTN_5_ETS = 3105,
    KEYCODE_BTN_6_ETS = 3106,
    KEYCODE_BTN_7_ETS = 3107,
    KEYCODE_BTN_8_ETS = 3108,
    KEYCODE_BTN_9_ETS = 3109,
    KEYCODE_DAGGER_CLICK_ETS = 3211,
    KEYCODE_DAGGER_DOUBLE_CLICK_ETS = 3212,
    KEYCODE_DAGGER_LONG_PRESS_ETS = 3213
};

KeyCode ConvertEtsKeyCode(int32_t keyCode);

} // namespace MMI
} // namespace OHOS
#endif // OHOS_MULTIMODALINPUT_KEY_CODE_IMPL_H
